package com.neusoft.lohas.modules.ivm.entity.mall;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.neusoft.lohas.common.persistence.IdEntity;

/**
 * 商圈PC端首页热点图片entity
 * 
 * @author jackie.liu
 * @version 2015-04-09
 */
@Entity
@Table(name = "ivm_mall_index_hot")
@DynamicInsert
@DynamicUpdate
public class IndexHot extends IdEntity<IndexHot> {

	private static final long serialVersionUID = 1L;
	private IndexPhoto indexPhoto; // 对应热点图片的数据Id
	private String position; // 热点位置
	private String url; // 链接

	public IndexHot() {
		super();
	}

	public IndexHot(String id) {
		this();
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="photo_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@JsonIgnore
	@NotNull(message="所属热点图片信息不能为空")
	public IndexPhoto getIndexPhoto() {
		return indexPhoto;
	}

	public void setIndexPhoto(IndexPhoto indexPhoto) {
		this.indexPhoto = indexPhoto;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
